package com.learner.pojo.blog;

import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.ToString;
import org.hibernate.annotations.*;

import javax.persistence.*;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
* @author ice2020x
* @Date: 2023/2/23
* @Description: 博客信息
**/
@Data
@Entity
@ToString
@Table(name = "blog_main")
@TableName("blog_main")
@GenericGenerator(name = "jpa-uuid", strategy = "uuid")
@SQLDelete(sql = "update blog_main set status = 1 where id = ?")
@Where(clause = "status = 0")
public class Blog  implements Serializable {

    private static final long serialVersionUID = -1L;
    @Id
    @GeneratedValue(generator = "jpa-uuid")
    private String id;

    private String title;


    private String content;

    /**
     * 编辑模式：html可视化，markdown ..
     */
    private String editMode;


    private String overview ;


    /**
     * 分类id
     */
    private Long categoryId;


    private String posterId;


    private Integer voteUp;


    private Integer voteDown;


    /**
     * 访问量
     */
    private Integer viewCount;

    /**
     * 评论数量
     */
    private Integer commentCount;

    /**
     * 是否为精华
     */
    private Integer recommend;

    /**
     * 置顶等级 1为置顶 0为正常
     */
    private Integer level;
    /**
     * 逻辑删除
     */
    private Integer status;

    @CreationTimestamp
    private Date createTime;

    @UpdateTimestamp
    private Date updateTime;

}
